/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package esnipe2;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.TimeZone;

/**
 *
 * @author hangsu
 */
public class Esnipe2 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        
        String url = "http://www.ebay.com/itm/BlackBerry-Curve-8530-Verizon-Smartphone-Christmas-BRAND-NIB-Car-Charger-Belt-/180770244802?pt=Cell_Phones&hash=item2a16bf08c2#ht_500wt_951";
        String url2 = "http://www.ebay.com/itm/STARBUCKS-VIA-150-SERVINGS-100-Natural-Roasted-Instant-Coffee-50pks-/260917445101?pt=LH_DefaultDomain_0&hash=item3cbfe441ed#ht_500wt_951";
        Calendar cal1 = Calendar.getInstance(TimeZone.getTimeZone("PST"));
        /*Calendar cal2 = new GregorianCalendar(cal1.get(Calendar.YEAR),
                cal1.get(Calendar.MONTH),
                cal1.get(Calendar.DAY_OF_MONTH),
                cal1.get(Calendar.HOUR_OF_DAY),
                cal1.get(Calendar.MINUTE),
                cal1.get(Calendar.SECOND)-1);*/
        Calendar cal2 = (Calendar)cal1.clone();
        cal2.add(Calendar.SECOND, -1);
        cal2.setTimeZone(TimeZone.getTimeZone("PST"));
        //System.out.print(cal2.before(cal1));
        Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("PST"));
                SimpleDateFormat format;
        format = new SimpleDateFormat("kk:mm:ss MMM dd, yyyy");
        format.setTimeZone(TimeZone.getTimeZone("PST"));
        Date date = cal.getTime();
        //System.out.println(format.format(date));
        String calS = "Dec 19, 201117:45:02 PST";
        Calendar calcal = EbayAPIImpl.parseCal(calS);
        System.out.println(EbayAPIImpl.parseCalInv(calcal));
        
    }
}
